package com.quikin.persistence.jpa.util;

import java.text.DecimalFormat;


import com.von.platform.dk.util.SEVERITY;

public enum QuikinPLErrorCode {

    DATA_INCORRECT(SEVERITY.ERROR),
    USER_NOT_EXIST(SEVERITY.FAIL),
    USER_LOGINID_NOT_EXIST(SEVERITY.FAIL),
    USER_PASSWORD_INCORRECT(SEVERITY.FAIL);

    SEVERITY severity;
    
    QuikinPLErrorCode(SEVERITY severity) {
        this.severity = severity;
    }
    
    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("QIN_"); // Transaction
        DecimalFormat df = new DecimalFormat("0000");
        sb.append(df.format(this.ordinal()));
        return sb.toString();
    }
    
    public String getSeverityString() {
        return this.severity.toString();
    }
    
    public SEVERITY getSeverity() {
        return this.severity;
    }

    public static void main(String[] args) throws Exception {
        
        QuikinPLErrorCode[] values = QuikinPLErrorCode.values();
        for (int ii=0; ii<values.length; ii++) {
            System.out.println("#"+values[ii].name());
            System.out.println(values[ii].toString()+"=");
            System.out.println("");
        }
    }
}
